package com.br.nninn.api;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.UriInfo;

import com.br.nninn.controller.NninnController;

@Path("/search")
public class NninnAPI implements INninnAPI {
	
	@Context
	UriInfo uriInfo;
	
	@Context
	Request request;
	
	private NninnController controller;
	
	public NninnAPI() {
		this.controller = new NninnController();
	}

	@GET
	@Override
	@Path("{lat}/{long}")
	@Produces(MediaType.TEXT_HTML)
	public String search(@PathParam("lat") String latitude, @PathParam("long")  String longitude) {
		return this.controller.search(latitude, longitude);
	}
	
	@GET
	@Override
	@Path("{state}")
	@Produces(MediaType.TEXT_PLAIN)
	public String stateMachine() {
		return this.controller.stateMachine();
	}

}
